<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
       .main{
            list-style-type: none;
            text-align: center;
            margin-top: 50px;
            font-size: 0;
        }
   .main>li{
       
        display: inline-block;
        border: 1px solid orange;
        font-size: 16px;
        border-right: none;
        width:  100px;
        line-height: 30px;
        position: relative;
        cursor: pointer;
        }
        .main>li:hover{
            background-color: aqua;
        }
        .main>li:last-child{
            border: 1px solid orange;
        }
        .submain{
            list-style-type: none;
            position: absolute;
            left: 0;
            top: 45px;
            display: none;
        }
        .submain li{
            border: 1px solid green;
            border-bottom: none;
            width: 100px;
            line-height: 30px;
            font-size: 16px;
            cursor: pointer;
        }
        .submain li:hover{
            background-color: rgb(139, 62, 62);
        }
        .submain li:last-child{
            border: 1px solid green;
        }
    </style>
</head>
<body>
    <ul class="main">
        <li>新闻
            <ul class="submain">
                <li>国内新闻</li>
                <li>国际新闻</li>
                <li>花边新闻</li>
            </ul>
        </li>
        <li>娱乐
            <ul class="submain">
                <li>靠队友</li>
                <li>吞日月</li>
                <li>撩妹子</li>
            </ul>
        </li>
        <li>游戏
            <ul class="submain">
                <li>王者农药</li>
                <li>英雄联盟</li>
                <li>穿越火线</li>
            </ul>
        </li>
        <li>账号
            <ul class="submain">
                <li>修高资料</li>
                <li>退出登录</li>
                
            </ul>
        </li>
    </ul>
</body>
<script src="../lib/jquery.min.js"></script>
<script>
    $(function(){
        $(".main>li").hover(
            function(){
                $(this).children(".submain").stop().slideDown()
            },
            function(){
                $(this).children(".submain").stop().slideUp()
            }
        )
    });
</script>
</html>